<?php
/**
 * template engine based on smarty
 * @requires Smarty
 * @see http://smarty.net
 */

require 'smarty/Smarty.class.php';

class template {

	static $smarty = null;

	static private function smarty() {
		if (self::$smarty) return self::$smarty;
		self::$smarty = new Smarty();
		return self::$smarty;
	}

	static public function assign($name, $value) {
		return self::smarty()->assign($name, $value);
	}

	static public function fetch($tpl) {
		return self::smarty()->fetch($tpl);
	}
}
